/**
 * author: wancheng
 * date: 2018/08/1
 * des: 考勤管理-拜访客户申请
 */
import request from '@/utils/request'

/**
 * get 获取申请信息
 * @param {*} params
 */
export function getListApi(params) {
  return request({
    url: '/attendanceoutsides/findAll',
    method: 'get',
    params: params
  })
}

/**
 * 编辑外出申请， 提交申请，编辑申请
 */
export function editOutApplyApi(data) {
  return request({
    url: '/attendanceoutsides/update?type=2',
    method: 'post',
    data: data
  })
}


/**
 * 发起出行申请
 */
export function addOutApplyApi(data) {
  return request({
    url: '/attendanceoutsides/insert?type=2',
    method: 'post',
    data: data
  })
}

/**
 * 删除出行申请
 */
export function deleteOutApplyApi(id) {
  return request({
    url: '/attendanceoutsides/delete/' + id + '/2?type=2',
    method: 'delete'
  })
}

/**
 * get 获取员工信息
 * @param {*} params
 */
export function getEmoApi() {
  return request({
    url: '/commonquerys/queryEmplInfoByUserId',
    method: 'get'
  })
}


/**
 * get 获取单条出行信息
 * @param {*} params
 */
export function getOutSideDataApi(id) {
  return request({
    url: '/attendanceoutsides/costDetail/' + id + '/2?type=2',
    method: 'get'
  })
}

/**
 * 新增报销申请
 */
export function sendOutApplyApi(data) {
  return request({
    url: '/attendanceoutsides/insertCost?type=2',
    method: 'post',
    data: data
  })
}

/**
 * 修改报销申请
 */
export function sendEditOutApplyApi(data) {
  return request({
    url: '/attendanceoutsides/updateCost?type=2',
    method: 'post',
    data: data
  })
}

/**
 * 获取客户的下拉列表
 */
export function getCustomersList() {
  return request({
    url: '/hrcustomers/findAll',
    method: 'get'
  })
}




/**
 * 再提交、保存
 */
export function updateBack(data) {
  return request({
    url: '/attendanceoutsides/updateBackOutside',
    method: 'post',
    data
  })
}


export function giveupdata(data) {
  return request({
    url: '/attendanceoutsides/giveupOutside',
    method: 'delete',
    params: data
  })
}



/**
 * 退回修改
 * @param {*} data
 */
export function updateBackCost(data) {
  return request({
    url: '/attendanceoutsides/updateBackCost',
    method: 'post',
    data
  })
}

/**
 * 放弃报销
 * @param {*} data
 */

export function giveupCost(data) {
  return request({
    url: '/attendanceoutsides/giveupCost',
    method: 'post',
    data
  })
}


/**
 * 删除报销
 * @param {*} id
 */
export function deleteCost(id) {
  return request({
    url: '/attendanceoutsides/deleteCostApply/' + id + '/2',
    method: 'delete'
  })
}

